import React, { Component } from 'react'
import { Button } from 'antd'

interface Greeting {
  name: string
  firstName?: string
  lastName?: string
}
interface State {
  count: number
}
//类组件
class HelloClass extends Component<Greeting, State> {
  state: State = {
    count: 0
  }
  static defaultProps = {
    firstName: '',
    listName: ''
  }
  render () {
    return (
      <div>
        <p>你点击了{ this.state.count } </p>
        <Button onClick={ ()=>{ this.setState({ count: this.state.count + 1}) } }>Hhello { this.props.name } </Button>
      </div>
    )
  }
}

export default HelloClass